package com.jihe.com;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class Test {
    public static void main(String[] args) {
        Collection coll = new ArrayList();
        coll.add("Tom");
        coll.add("Jerry");
        coll.add("Mary");
        System.out.println(coll.size());
        boolean flag = coll.contains("Tom");
        System.out.println(flag);

//迭代器对象
        Iterator ito = coll.iterator();
        while (ito.hasNext()) {
            Object o = ito.next();
            String s = (String) o;

            System.out.println(s);
        }
    }
}
